package com.lanlian.commonlib.bean.db;

import com.lanlian.commonlib.bean.MessageInfo;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.io.Serializable;

/**
 * <pre>
 *     author : huxiaobo
 *     e-mail : huxiaobo@xlanlian.com
 *     date   : 2018/9/14 16:19
 *     desc   : 本地消息数据
 *     version: 1.0
 * </pre>
 */
@Entity
public class DBMessage implements Serializable {

    @Id
    private Long id;
    private Integer isRead;
    private Integer type;
    private String title;
    private String content;
    private String pushTime;

    public String getPushTime() {
        return this.pushTime;
    }

    public void setPushTime(String pushTime) {
        this.pushTime = pushTime;
    }

    public String getContent() {
        return this.content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getType() {
        return this.type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getIsRead() {
        return this.isRead == null ? 0 : this.isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }
    
    @Generated(hash = 1263800108)
    public DBMessage(Long id, Integer isRead, Integer type, String title,
            String content, String pushTime) {
        this.id = id;
        this.isRead = isRead;
        this.type = type;
        this.title = title;
        this.content = content;
        this.pushTime = pushTime;
    }

    @Generated(hash = 1698487654)
    public DBMessage() {
    }

    public DBMessage(MessageInfo messageInfo) {
        this.id = messageInfo.getId().longValue();
        this.type = messageInfo.getType();
        this.title = messageInfo.getTitle();
        this.content = messageInfo.getContent();
        this.pushTime = messageInfo.getPushTime();
    }

}
